package ch04;

class FlowEx22 {
	public static void main(String[] args) {
		int sum = 0;
		int i = 0;

		while (true) {
			if (sum > 100) break; // can be used inside of a loop or a switch.
			sum += ++i;			
		}

		System.out.println("i=" + i);
		System.out.println("sum=" + sum);
	}
}
/*
i=14
sum=105
*/